package com.tom.architect02.mnbase.annotation.fs;

import androidx.annotation.DrawableRes;
import androidx.annotation.IntDef;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Added by Tom on 2024/08/16.
 */
public class Test {
    public static void main(String[] args) {
        // setDrawable(R.drawable.ic_launcher_background);
        setCurrentDay(SUNDAY);
        // setCurrentDay(0); // Must be one of: Test.SUNDAY, Test.MONDAY
    }

    private static final int SUNDAY = 0;
    private static final int MONDAY = 1; // 常量：占用4个字节。
    @IntDef({SUNDAY, MONDAY})
    @Target({ElementType.PARAMETER, ElementType.FIELD})
    @Retention(RetentionPolicy.SOURCE)
    @interface WekDay {
    }
    @WekDay
    private static int mCurrentDay;

    // 语法检查，限定设置的值。
    public static void setCurrentDay(@WekDay int currentDay) {
        mCurrentDay = currentDay;
    }
    public static void setDrawable(@DrawableRes int id) {
    }
}
